<include file="Public:header"/>
<div class="aright">
          
<fieldset class="layui-elem-field layui-field-title" style="margin: 20px 30px 20px 20px;">
  <legend>修改栏目</legend>
</fieldset>

<form class="layui-form bform" method="post" action="{:U('category/doedit')}" enctype="multipart/form-data">
  <input type="hidden" name="id" value="{$c.id}">
  <div class="layui-form-item">
    <label class="layui-form-label">栏目名称</label>
    <div class="layui-input-block">
      <input type="text" name="name" value="{$c.name}" required lay-verify="required" placeholder="必填内容" autocomplete="off" class="layui-input">
    </div>
  </div>

  <div class="layui-form-item" style="width: 300px;">
    <label class="layui-form-label">所属栏目</label>
    <div class="layui-input-block">
      <select name="tid">
       <option value="0">顶级栏目</option>
        <volist name="cs" id="vo">
        <option <if condition="$c[id] eq $vo[id]">disabled</if>
		<if condition="$c[tid] eq $vo[id]">selected="selected"</if>value="{$vo.id}"><?php echo str_repeat('-',$vo[level]*8);?>{$vo.name}</option>
        </volist>
      </select>
    </div>
  </div>

  <div class="layui-form-item">
    <label class="layui-form-label">所属类型</label>
    <div class="layui-input-block">
      <input type="radio" name="type" value="1" title="文章" <if condition="$c['type'] eq 1">checked=""</if>>
      <input type="radio" name="type" value="2" title="产品" <if condition="$c['type'] eq 2">checked=""</if>>
    </div>
  </div>
  
  <div class="layui-form-item">
    <label class="layui-form-label">缩略图</label>
     <div class="layui-input-block">
     <div class="file-box">
     <i class="layui-icon">&#xe61f;</i>
     <input class="file-btn" type="button" value="选择图片"> 
     <input class="file-txt" type="text" autocomplete="off" name="textfield" id="textfield"><if condition="$c[pic] neq ''"><img src="__ROOT__/Uploads{$c.pic}" height="50"><else/></if>
     <input class="file-file" type="file" name="pic" id="pic" size="28" onchange="document.getElementById('textfield').value=this.value" /> 
     </div>
     </div>
  </div>

  <div class="layui-form-item">
    <label class="layui-form-label">关键词</label>
    <div class="layui-input-block">
      <input type="text" name="keywords" value="{$c.keywords}" placeholder="请输入内容" autocomplete="off" class="layui-input">
    </div>
  </div>

  <div class="layui-form-item layui-form-text">
    <label class="layui-form-label">描述</label>
    <div class="layui-input-block">
      <textarea name="description" placeholder="请输入内容" class="layui-textarea">{$c.description}</textarea>
    </div>
  </div>

  <div class="layui-form-item">
    <div class="layui-input-block">
	  <button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
      <button class="layui-btn layui-btn-primary" onclick="history.go(-1)">返回</button>
    </div>
  </div>

</form>
<script>
layui.use('form', function(){
  var form = layui.form();
});
</script>
</div>
</div>
</body>
</html>